#pragma once
/*****************************************************************************/
/* File: Common.h                                                            */
/* Author: Ozon                                                              */
/*                                                                           */
/* Description:																 */
/*	File with declarations and references common for all units.				 */
/*****************************************************************************/

#define dDOUBLE			//double precision of ODE

//#define SHOWFPS

#include <windows.h>
#include <ode\ode.h>
#include <gl\gl.h>
#include <gl\glu.h>
#include <gl\glext.h>
#include "Utils.h"

#define PI 3.1415926
#define KEY_DOWN(vk_code) ((GetAsyncKeyState(vk_code) & 0x8000) ? 1 : 0)
#define KEY_UP(vk_code)   ((GetAsyncKeyState(vk_code) & 0x8000) ? 0 : 1)

//free allocated object by pointer
#define DELETE_OBJECT(obj) if(obj) { delete obj; obj = NULL; }

//types of drawable objects:
#define TYPE_BALL		1
#define TYPE_BAT		2
#define TYPE_BRICK		3
#define TYPE_LIMITER	4
#define TYPE_BONUS		5

//types of bonuses
enum BONUSTYPE
{
	BT_NONE,
	BT_EXPAND,
	BT_STICK,
	BT_CLONE,
	BT_LAST
};

#define BONUSTYPE_NUM BT_LAST

#ifdef _UNICODE
#define _T(x)      L ## x
#else /* _UNICODE */
#define _T(x)      x
#endif /* _UNICODE */

extern float g_fTime;
extern bool g_bTwoPlayers;
extern bool g_bQuit;
extern HWND g_hWnd;

//extension functions (definitions <references> in CRenderer)
// VBO Extension Function Pointers
extern PFNGLGENBUFFERSARBPROC glGenBuffersARB;					// VBO Name Generation Procedure
extern PFNGLBINDBUFFERARBPROC glBindBufferARB;					// VBO Bind Procedure
extern PFNGLBUFFERDATAARBPROC glBufferDataARB;					// VBO Data Loading Procedure
extern PFNGLDELETEBUFFERSARBPROC glDeleteBuffersARB;				// VBO Deletion Procedure
extern PFNGLISBUFFERARBPROC glIsBufferARB;